package com.qfedu.aunt.commons.controller;


import com.qfedu.aunt.commons.pojo.EmployerCollection;
import com.qfedu.aunt.commons.result.R;
import com.qfedu.aunt.commons.service.EmployerCollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 雇主收藏表 前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2022-10-26
 */
@RestController
@RequestMapping("/aunt/commons/employer/collection")
@Api(description = "雇主收藏模块",tags = "雇主的收藏模块")
public class EmployerCollectionController {


    @Autowired
    private EmployerCollectionService employerCollectionService;

    /**
     * 通过雇主的id查询雇主的收藏信息
     * @param employerId
     * @return
     */
    @ApiOperation(value = "通过雇主id查询雇主的收藏信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "employerId",value = "雇主id",dataType = "string",paramType = "path",required = true),
            @ApiImplicitParam(name = "token",value = "用户身份标识",dataType = "string",paramType = "header",required = true)
    })
    @GetMapping("/findCollectionByEmployerId/{employerId}")
    public R findCollectionByEmployerId(@PathVariable("employerId") String employerId)throws Exception{
        /**
         * 这里收藏的有阿姨
         * 还有经纪人
         */
        Map<String,Object> maps=employerCollectionService.findCollectionByEmployerId(employerId);
        return R.ok().setData("aunt",maps.get("aunt")).setData("agent",maps.get("agent"));
    }



}

